<template>
  <div class="bg-white mt-[10px]">
    <BaseHead style="border-bottom: 0">基本信息</BaseHead>
    <BaseTable>
      <tr>
        <td class="td-name">评审计划名称</td>
        <td colspan="3">{{ detailData.name }}</td>
      </tr>
      <tr>
        <td class="td-name">评审方案</td>
        <td colspan="3">
          {{ detailData.reviewSchemeName }}
        </td>
      </tr>
      <tr>
        <td class="td-name">开始日期</td>
        <td><DateLabel :value="detailData.beginDate" /></td>
        <td class="td-name">结束日期</td>
        <td><DateLabel :value="detailData.endDate" /></td>
      </tr>
      <tr>
        <td class="td-name">申请指南</td>
        <td colspan="3">
          <template v-if="detailData.fileInfo">
            <p v-for="item in detailData.fileInfo" :key="item.id" class="my-[5px]">
              {{ item.fileName }}
              <el-link
                type="primary"
                @click="handleDownload(item.id, item.fileName)"
                class="ml-[5px]"
                >下载</el-link
              >
            </p>
          </template>
        </td>
      </tr>
      <tr>
        <td class="td-name">备注</td>
        <td colspan="3">{{ detailData.note }}</td>
      </tr>
    </BaseTable>
  </div>
</template>

<script setup>
import BaseHead from "@/views/project/components/BaseHead.vue";
import BaseTable from "@/views/project/components/BaseTable.vue";
import DateLabel from "@/views/project/components/DateLabel.vue";
import { recordsDetail } from "@/api/project/xj/xmps";
import { handleDownload } from "@/utils/main";
const props = defineProps({
  operateId: String,
});
const detailData = ref({});
//获取记录详情
const getDetail = async () => {
  try {
    const params = {
      planId: props.operateId,
    };
    const res = await recordsDetail(params);
    detailData.value = res.data;
  } catch (error) {
    console.log(error);
  }
};
onMounted(() => {
  getDetail();
});
</script>

<style scoped lang="scss"></style>
